<template>
    <div class="navi">
        <div class="na-left">
            <i :class="icon" style="font-size: 25px; color: #666;line-height: 50px;" @click="changeCollapse"></i>
        </div>
        <div class="na-right">
            <img :src="userInfo.adminUrl">
            {{userInfo.adminName}}
            <button @click="logout">退出</button>
        </div>
    </div>
</template>

<script>

export default {
    name:'HeadNavigation',
    props:['logout','changeCollapse','icon'],
    data(){
        return {
            userInfo:JSON.parse(localStorage.getItem('user'))
        }
    }
}
</script>

<style scoped>
.navi{
    /* 在宽100%基础上减220px */
    width: calc(100% - 200px);
    height: 50px;
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, .15);
    
}
.na-left{
    width: 50px;
    height: 100%;
    float: left;
    margin-left: 10px;
}
.na-right{
    width:200px;
    height: 50px;
    float: right;
    line-height: 50px;
    text-align: right;
    padding: 0 30px;
    font-size: 14px;
    color: rgba(0, 0, 0, .15);
}
.na-right>img{
    width: 30px;
    height: 30px;
    line-height: 50px;
    vertical-align: middle;
    border-radius: 50%;
}
.na-right>button{
    border: none;
    width: 50px;
    height: 25px;
    border-radius: 20px;
    font-size: 14px;
    background-color: rgb(43, 122, 226);
    color: #fff;
    cursor: pointer;
}
.na-right>button:hover{
    background-color: orangered;
}
</style>